//
//  XJTool.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/5/15.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJTool.h"

static NSString *const kLocalPhone = @"kLocalPhone";
@implementation XJTool
/**6-20 判断字符串是否为空*/
+ (BOOL)isEmptyStr:(NSString *)string {
    if (string == nil || string == NULL) {
        return YES; // 空
    }
    
    if ([string isKindOfClass:[NSNull class]]) {
        return YES; // 空
    }
    
    // 去掉空格和换行
    string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    if (string.length == 0) {
        return YES; // 空
    }
    return NO; // 非空
}

#pragma mark - 保存手机号
+ (void)xj_savePhone:(NSString *)phone {
    [[NSUserDefaults standardUserDefaults] setValue:phone forKey:kLocalPhone];
}

+ (NSString *)xj_localPhone{
    return [[NSUserDefaults standardUserDefaults] objectForKey:kLocalPhone];
}
@end
